package com.daxue.testconsumer.task;

import com.daxue.testconsumer.service.TestConsumerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @author Admin
 * @date 2020/05/01
 **/

@Service
@Slf4j
public class AutoGlobalTask {

    @Autowired
    TestConsumerService testConsumerService;

    @Scheduled(cron = "0/5 * * * * *")
    public void autoTestConsumerServiceTest01() {
        try {
            String s = testConsumerService.test01();
            log.info("my consumer   --------   {}", s);
        }catch (Exception e) {
            log.error(e.getMessage());
        }
    }

}
